import React from 'react'
import ReactDOM from 'react-dom'

class Yshusen extends React.Component {
  state = {
    msg: 'Hello JSX',
    num: 1,
  }
  render() {
    return (
      <div>
        <div>{this.state.msg}</div>
        <div>{this.state.num}</div>
        <button onClick={this.handleClick}>点我</button>
        <button onClick={() => alert('hhhhhh')}>点我</button>
        <button onClick={this.handleCelick}>获取事件对象，点我</button>
      </div>
    )
  }
  handleClick() {
    console.log('点击事件触发了')
  }
  handleCelick(e) {
    console.log(e)
  }
}
const App = () => (
  <>
    <header>
      <div>内容主题</div>
      <h1>测试标题</h1>
      <Yshusen />
    </header>
  </>
)

ReactDOM.render(<App />, document.getElementById('root'))
